<template>
	<view class="content">
		<view class="header_tab">
			<view class="title">德通产业平台</view>
			<view class="tabs">
				<block v-for="(item,index) in tabs" :key="index">
					<view :class="index==current?'act':''" @click="current=index">{{item}}</view>
				</block>
			</view>
		</view>
		<view class="swips">
			<swiper :current="current" :autoplay="false" :duration="100" @change="changeSwiper" class="swipce-box" :style="'height:'+ScroHeight+'px'">
				<swiper-item>
					<scroll-view :scroll-y="true" :style="'height:'+ScroHeight+'px'">
						<view class="cont">
							<image :src="qihang.cover" class="haer_img"></image>
							<view class="contents" v-html="qihang.info"></view>
							<view class="hehuo">
								<view class="in_top">
									<view class="inps">
										<u-input v-model="name" placeholder="请输入姓名"  style="background-color:#f5f5f5;border-radius: 40rpx;" />
									</view>
									<pca-picker-cc :addressList.sync="addressList">
										 <view class="pick">
											 {{ addressList.join(' ') }}
											 <u-icon name="arrow-down"></u-icon>
										 </view>
									</pca-picker-cc>
								</view>
								<u-input type="number" v-model="phone" placeholder="请输入手机号" style="background-color:#f5f5f5;border-radius: 40rpx;padding-left: 30rpx;" />
							</view>
							<view class="btns" @click="submit">提交</view>
							<view class="tishi">备注： 该信息仅您和系统后台可见。</view>
						</view>
					</scroll-view>
				</swiper-item>
				<swiper-item>
					<scroll-view :scroll-y="true" :style="'height:'+ScroHeight+'px'">
						<view class="cont">
							<image :src="jiyu.cover" class="haer_img"></image>
							<view class="contents contents2" v-html="jiyu.info"></view>
							<view class="hehuo">
								<view class="in_top">
									<view class="inps">
										<u-input v-model="name" placeholder="请输入姓名"  style="background-color:#f5f5f5;border-radius: 40rpx;" />
									</view>
									<pca-picker-cc :addressList.sync="addressList">
										 <view class="pick">
											 {{ addressList.join(' ') }}
											 <u-icon name="arrow-down"></u-icon>
										 </view>
									</pca-picker-cc>
								</view>
								<u-input type="number" v-model="phone" placeholder="请输入手机号" style="background-color:#f5f5f5;border-radius: 40rpx;padding-left: 30rpx;" />
							</view>
							<view class="btns" @click="submit">提交</view>
							<view class="tishi">备注： 该信息仅您和系统后台可见。</view>
						</view>
					</scroll-view>
				</swiper-item>
				<swiper-item>
					<scroll-view :scroll-y="true" :style="'height:'+ScroHeight+'px'">
						<view class="cont">
							<image src="@/static/banner3.png" class="haer_img"></image>
							<view class="liucheng_box">
								<view class="liu_box">
									<view class="tit">身份确认</view>
									<view class="text_cont">签订协议，成为德通城市合伙人、行业合伙人、普通合伙人、授权合伙人</view>
								</view>
								<image src="../../static/jt.png" class="liu_img"></image>
								<view class="liu_box">
									<view class="tit">平台赋能</view>
									<view class="text_cont">平台根据合伙人资源情况，利用平台市场信息和产品体系优势，赋能有效项目意向的挖掘，帮助合伙人成单；</view>
								</view>
								<image src="../../static/jt.png" class="liu_img"></image>
								<view class="liu_box">
									<view class="tit">签单回款</view>
									<view class="text_cont">利用平台丰富产品体系，变现手中关系资源，签单并回款</view>
								</view>
								<image src="../../static/jt.png" class="liu_img"></image>
								<view class="liu_box">
									<view class="tit">利益分成</view>
									<view class="text_cont">按合伙人协议中规定的平台佣金系数抽成</view>
								</view>
								
							</view>
							<view class="hehuo">
								<view class="in_top">
									<view class="inps">
										<u-input v-model="name" placeholder="请输入姓名"  style="background-color:#f5f5f5;border-radius: 40rpx;" />
									</view>
									<pca-picker-cc :addressList.sync="addressList">
										 <view class="pick">
											 {{ addressList.join(' ') }}
											 <u-icon name="arrow-down"></u-icon>
										 </view>
									</pca-picker-cc>
								</view>
								<u-input type="number" v-model="phone" placeholder="请输入手机号" style="background-color:#f5f5f5;border-radius: 40rpx;padding-left: 30rpx;" />
							</view>
							<view class="btns" @click="submit">提交</view>
							<view class="tishi">备注： 该信息仅您和系统后台可见。</view>
						</view>
					</scroll-view>
				</swiper-item>
				<swiper-item>
					<scroll-view :scroll-y="true" :style="'height:'+ScroHeight+'px'">
						<view class="cont">
							<image src="../../static/banner5.png" class="haer_img"></image>
							<view class="bont4">
								<view class="botn_tab">
									<view>产品分类</view>
									<view>介绍意向</view>
									<view>配合成单</view>
									<view>直接签单</view>
									<view>全程负责</view>
								</view>
								<view class="item1">
									<view class="left">
										<view>标准产品</view>
										<text>设备、材料</text>
									</view>
									<view>0.5%</view>
									<view>0.75%</view>
									<view style="padding: 0 32rpx;">5%</view>
									<view style="border-right: 0;">6%</view>
								</view>
								<view class="item1" style="border-bottom: 0;">
									<view class="left">
										<view>工程类</view>
										<text>施工咨询项目</text>
									</view>
									<view>0.2%</view>
									<view style="padding: 0 32rpx;">0.5%</view>
									<view style="padding: 0 32rpx;">4%</view>
									<view style="border-right: 0;">5%</view>
								</view>
							</view>
							<view class="beizhu">备注说明：</view>
							<view class="tishi1">1. 佣金按回款比例，10个工作日内支付到位。</view>
							<view class="hehuo">
								<view class="in_top">
									<view class="inps">
										<u-input v-model="name" placeholder="请输入姓名"  style="background-color:#f5f5f5;border-radius: 40rpx;" />
									</view>
									<pca-picker-cc :addressList.sync="addressList">
										 <view class="pick">
											 {{ addressList.join(' ') }}
											 <u-icon name="arrow-down"></u-icon>
										 </view>
									</pca-picker-cc>
								</view>
								<u-input type="number" v-model="phone" placeholder="请输入手机号" style="background-color:#f5f5f5;border-radius: 40rpx;padding-left: 30rpx;" />
							</view>
							<view class="duoxuan">
								<view class="titiles">
									<image src="@/static/left_img.png" mode=""></image>
									<text>您的资源集中在那个领域？</text>
									<image src="@/static/rig_img.png" mode=""></image>
									<view class="">(多选)</view>
								</view>
								<view class="box">
									<u-checkbox-group @change="checkboxGroupChange">
										<u-checkbox 
											v-model="item.checked"
											v-for="(item, index) in list" :key="index" 
											:name="item.name"
											shape="circle"
										>{{item.name}}</u-checkbox>
									</u-checkbox-group>
								</view>
							</view>
							<view class="btns" @click="submit">提交</view>
							<view class="tishi">备注： 该信息仅您和系统后台可见。</view>
						</view>
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
	import {
		cypt,postSubmit
	} from '@/api/api.js'
	export default {
		data() {
			return {
				ScroHeight:'',
				tabs:['德通起航','产业机遇','合作流程','成为合伙人'],
				current:0,//当前列表
				jiyu: "",// 机遇数据
				qihang: "",//起航数据
				addressList: ["", "",""],
				list:[{
					name:'交通',
					checked:false
				},{
					name:'城建',
					checked:false
				},{
					name:'水利',
					checked:false
				},{
					name:'铁路',
					checked:false
				},{
					name:'机场',
					checked:false
				},{
					name:'市政设施',
					checked:false
				},{
					name:'生态环境',
					checked:false
				},{
					name:'预拌混凝土企业',
					checked:false
				},{
					name:'多功能搅拌工厂',
					checked:false
				},{
					name:'政府投资平台企业',
					checked:false
				},{
					name:'公路建设养护企业',
					checked:false
				},{
					name:'市政工程建设养护企业',
					checked:false
				}],
				name:'',// 姓名
				phone:'',//手机号
				address:'',//地址
				field:'',//领域
			};
		},
		onLoad() {
			console.log(this.$u.test.mobile('11045678900'),this.addressList[0]);
			this.ScroHeight = uni.getSystemInfoSync().windowHeight - 200;
			this.c_ypt()
			//分享微信好友
			if (this.$wechat && this.$wechat.isWechat()) {
				this.$wechat.share();
			}
			
		},
		methods:{
			// 选中任一checkbox时，由checkbox-group触发
			checkboxGroupChange(e) {
				console.log(e);
				this.field=e
			},
			changeSwiper(e){
				console.log(e);
				this.current = e.detail.current
			},
			submit(){
				console.log(this.addressList[0]);
				if(!this.name){
					uni.showToast({
						title:'姓名不能为空',
						icon:'none'
					})
					return
				}else if(!this.phone){
					uni.showToast({
						title:'手机号不能为空',
						icon:'none'
					})
					return
				}else if(!this.$u.test.mobile(this.phone)){
					uni.showToast({
						title:'手机号格式不正确',
						icon:'none'
					})
					return
				}else if(this.addressList[0]=='全国'){
					uni.showToast({
						title:'请选择区域',
						icon:'none'
					})
					return
				}else if(this.current==3 && this.field.length==0){
					uni.showToast({
						title:'请选择您的资源集中领域',
						icon:'none'
					})
					return
				}
				let data={
					name:this.name,// 姓名
					phone:this.phone,//手机号
					address:this.addressList.toString(),//地址
					field:this.field.toString(),//领域
					type:this.current+1,//类型
				}
				postSubmit(data).then(res=>{
					if(res.code!=1){
						uni.showToast({
							title:res.msg,
							icon:'error'
						})
						return
					}else{
						uni.showToast({
							title:res.msg
						})
						this.name=''// 姓名
						this.phone=''//手机号
						this.field=''//领域
						this.list.forEach(v=>{
							v.checked=false
						})
					}
				})
			},
			c_ypt: function() {
				cypt({}).then(res => {
					console.log(res)
					this.jiyu = res.data.dt_jy;
					this.qihang = res.data.dt_qh
				})
			},
		}
	}
</script>

<style lang="less">
.content{
	.header_tab{
		background: url(../../static/bc.png) no-repeat;
		background-size: 100% 100%;
		height: 274rpx;
		.title{
			font-size: 36rpx;
			font-weight: 700;color: #fff;
			text-align: center;
			padding-top: 50rpx;
		}
		.tabs{
			display: flex;justify-content: space-between;
			margin-top: 53rpx;
			padding: 0 32rpx;
			view{
				color: #a9cbff;
				font-size: 32rpx;
			}
			.act{
				color: #fff;
			}
		}
	}
	.swips{
		background-color: #f2f8ff;
		.cont{
			padding: 0 32rpx;
			padding-bottom: 50rpx;
			.haer_img{
				display: block;margin: auto;
				width: 686rpx;height: 357rpx;
				margin-top: 22rpx;
			}
			.contents{
				margin-top: 35rpx;
				padding: 0 31rpx;
				padding-top: 48rpx;
				padding-bottom: 20rpx;
				position: relative;
				background-color: #fff;
				position: relative;
				&::before{
					content: '起航';
					display: block;
					position: absolute;top: -10px;left: 0;
					font-size: 31rpx;
					color: #FFFFFF;
					padding-left: 22rpx;
					line-height: 58rpx;
					height: 58rpx;
					width: 135rpx;
					background: url(../../static/jiao.png) no-repeat;
					background-size: 100% 100%;
				}
			}
			.contents2{
				&::before{
					content: '机遇';
				}
			}
			.hehuo{
				margin-top: 50rpx;background-color: #fff;
				padding: 0 22rpx;
				padding-top: 60rpx;position: relative;
				position: relative;padding-bottom: 35rpx;
				&::before{
					content: '成为合伙人';
					display: block;
					position: absolute;top: -10px;left: 0;
					font-size: 31rpx;
					color: #FFFFFF;
					padding-left: 22rpx;
					line-height: 58rpx;
					height: 58rpx;
					width: 238rpx;
					background: url(../../static/jiao.png) no-repeat;
					background-size: 100% 100%;
				}
				/deep/ input{
					padding:0 30rpx;
				}
				.in_top{
					display: flex;justify-content: space-between;align-items: center;
					margin-bottom: 27rpx;
					.inps{
						width: 270rpx;
					}
					.pick{
						display: flex;justify-content: space-between;align-items: center;
						background-color: #f5f5f5;
						border-radius: 40rpx;
						width: 343rpx;height: 66rpx;
						line-height: 66rpx;
						padding-left: 30rpx;padding-right: 10rpx;
					}
				}
			}
			.liucheng_box{
				// margin: 0 -32px ;
				.liu_box{
					background: url(../../static/bc1.png) no-repeat;
					background-size: 100% 100%;
					width: 686rpx;height: auto;
					margin-bottom: 10rpx;margin-top: 10rpx;
					padding: 0 49rpx;padding-bottom: 38rpx;
					padding-top: 10rpx;
					.tit{
						font-size: 32rpx;color: #4575FC;
						text-align: center;margin-bottom: 16rpx;
					}
					.text_cont{
						font-size: 28rpx;line-height: 50rpx;
					}
				}
				.liu_img{
					display: block;margin: auto;
					width: 61rpx;height: 61rpx;
				}
			}
			.bont4{
				margin-top: 23rpx;
				border-radius: 10rpx;
				padding: 29rpx 0 11rpx;
				background-color: #fff;
				.botn_tab{
					display: flex;align-items: center;justify-content: space-between;
					padding-left: 20rpx;padding-right: 18rpx;
					padding-bottom: 28rpx;margin-bottom: 7rpx;
					border-bottom: 1rpx solid #f0f0f0;
					view{
						font-size: 26rpx;
						&:nth-child(1){
							margin-right: 69rpx;
						}
					}
				}
				.item1{
					display: flex;align-items: center;
					padding-left: 20rpx;border-bottom: 1rpx solid #f0f0f0;
					padding-bottom: 20rpx;
					view{
						color: #4575FC;font-size: 30rpx;
						border-right: 1rpx solid #f0f0f0;
						padding: 0 25rpx;line-height: 42rpx;
					}
					.left{
						width: 195rpx;
						view{
							color: #333333;padding: 0;
							border-right: 0;line-height: auto;
						}
						text{
							font-size: 24rpx;color: #b7b7b7;
						}
					}
				}
			}
			.duoxuan{
				padding: 18rpx 0 40rpx;
				background-color: #fff;
				border-radius: 10rpx;margin-top: 21rpx;
				.titiles{
					display: flex;justify-content: center;align-items: center;
					padding-bottom: 12rpx;
					border-bottom: 1rpx solid #f2f2f2;
					image{
						width: 37rpx;height: 13rpx;
					}
					text{
						font-size: 30rpx;font-weight: 700;
						display: block;
						margin: 0 20rpx;
					}
					view{
						font-size: 25rpx;color: #959595;
						margin-left: 20rpx;
					}
				}
				.box{
					padding-left: 22rpx;
				}
			}
			.beizhu{
				font-size: 32rpx;margin-top: 20rpx;
				padding-left: 20rpx;margin-bottom: 10rpx;
			}
			.tishi1{
				padding-left: 20rpx;
				color: #b7b7b7;
				font-size: 24rpx;
			}
			.btns{
				background: url(../../static/btn.png) no-repeat;
				background-size: 100% 100%;
				height: 76rpx;line-height: 76rpx;
				text-align: center;color: #FFFFFF;font-size: 30rpx;
				margin-top: 45rpx;
			}
			.tishi{
				font-size:24rpx ;color: #333333;
				text-align: center;margin-top: 24rpx;
			}
		}
	}
}
</style>
